﻿@page "/post/{url}"
@model Meowv.Blog.Web.Pages.Posts.PostModel
@{
    var post = Model.Post.Result;

    ViewData["Title"] = $"{post.Title} - ";
}
<article class="post-wrap">
    <header class="post-header">
        <h1 class="post-title">@post.Title</h1>
        <div class="post-meta">
            Author: <a itemprop="author" rel="author" href="javascript:;">@post.Author</a>
            <span class="post-time">
                Date: <a href="javascript:;">@post.CreatedAt</a>
            </span>
            <span class="post-category">
                Category:<a href="/category/@post.Category.Alias">@post.Category.Name</a>
            </span>
        </div>
    </header>
    <div class="post-content">
        <component type="typeof(Meowv.Blog.Web.Components.VditorPreview)"
                   render-mode="ServerPrerendered"
                   param-Markdown="@post.Markdown" />
    </div>
    <section class="post-copyright">
        <p class="copyright-item">
            <span>Author:</span>
            <span>@post.Author</span>
        </p>
        <p class="copyright-item">
            <span>Permalink:</span>
            <span><a href="/post/@post.Url">https://meowv.com/post/@post.Url</a></span>
        </p>
        <p class="copyright-item">
            <span>License:</span>
            <span>本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-nc-nd/4.0/">BY-NC-SA</a> 许可协议。转载请注明出处！</span>
        </p>
    </section>
    <section class="post-tags">
        <div>
            <span>Tag(s):</span>
            <span class="tag">
                @foreach (var tag in post.Tags)
                {
                    <a href="/tag/@tag.Alias"># @tag.Name</a>
                }
            </span>
        </div>
        <div>
            <a href="javascript:history.go(-1);">back</a><span>· </span><a href="/">home</a>
        </div>
    </section>
    <section class="post-nav">
        @if (post.Previous != null)
        {
            <a class="prev" rel="prev" href="/post/@post.Previous.Url">@post.Previous.Title</a>
        }
        @if (post.Next != null)
        {
            <a class="next" rel="next" href="/post/@post.Next.Url">@post.Next.Title</a>
        }
    </section>
</article>
@section styles{
    <link href="https://cdn.jsdelivr.net/npm/vditor@3.4.7/dist/index.css" rel="stylesheet" />
}
@section scripts{
    <script src="https://cdn.jsdelivr.net/npm/vditor@3.4.7/dist/index.min.js"></script>
    <script src="_framework/blazor.server.js"></script>
    <script src="_content/Vditor/vditor-blazor.js"></script>
}